﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StarTrek.World
{
    public class QuadrantPoint
    {
        public int X;
        public int Y;
        public int Z;
        public QuadrantPoint(int X, int Y, int Z)
        {
            this.X = X;
            this.Y = Y;
            this.Z = Z;
        }

        public static QuadrantPoint ParseVector(string currentline)
        {
            int[] rVal = new int[3];
            string[] vectorText = currentline.Split(",".ToCharArray());

            if (!(int.TryParse(vectorText[0], out rVal[0]) &&
                  int.TryParse(vectorText[1], out rVal[1]) &&
                  int.TryParse(vectorText[2], out rVal[2])))
            {
                throw new ArgumentException("Invalid Vector");
            }

            return new QuadrantPoint(rVal[0], rVal[1], rVal[2]);
        }
    }

}
